<form th:action="@{/admin/c/user/updateRolesByUser.gsp}" id="addForm" role="form" action="#" method="post" class="form-horizontal">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title" th:text="|为用户【${result.realname}】分配角色|"></h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<input name="userId" th:value="${result.id}" type="hidden" />
			<div class="col-xs-12">
				<ul class="widget-todo">
					<li class="clearfix" th:each="role:${roles}" onclick="checkboxRoleLiClick(this)">
						<div class="checkbox-nice">
							<input type="checkbox" name="roleIds" th:checked="${role.userRoleId!=null}" th:id="${role.id}" th:value="${role.id}" /> <label style="text-decoration: none;" th:text="${role.roleName}"> </label>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn btn-primary" type="submit">
			<strong>提 交</strong>
		</button>
		<button type="button" class="btn btn-default" data-dismiss="modal">
			<strong>关 闭</strong>
		</button>
	</div>
</form>
<script th:inline="javascript">
    /*<![CDATA[*/
    function checkboxRoleLiClick(c) {
        $(c).find("input").trigger("click");
    }
    $(function() {
        tg_formWinAjaxSubmit("commonSmWin", "addForm", null, null);
    });
    /*]]>*/
</script>